﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using MusicStore.Domain.POCO;

using MusicStore.Domain.Concrete;

namespace MusicStore.WebUI.Controllers
{
    public class StoreController : Controller
    {
        EFDbContext db = new EFDbContext();
        //
        // GET: /Store/

        public ActionResult Index()
        {
            var genres = db.Genres.ToList<Genre>();
            return View(genres);
        }

        // GET: /Store/Browse
        public ActionResult Browse(string genre)
        {
            var g = db.Genres.Single<Genre>(x => x.Name == genre);
            return View(g);
        }

        // GET: /Store/Browse
        public ActionResult Details(int id)
        {
            var a = db.Albums.Include("Artist").Single<Album>(x => x.AlbumId == id);
            return View(a);
        }

    }
}
